Skip to content

feat(web): audio playback (RDPSND) through an audioPlayback callback - #2020

Open
meanaverage (meanaverage) wants to merge 1 commit into
Devolutions:masterfrom
meanaverage:feat/web-audio-playback
Open

meanaverage (meanaverage) wants to merge 1 commit into
Devolutions:masterfrom
meanaverage:feat/web-audio-playback

Conversation

@meanaverage

Copy link
Copy Markdown
Contributor

Problem

The web client has no audio output. It only attaches a no-op RDPSND processor (to satisfy RDPDR's channel dependency when a printer is redirected), so the remote desktop's sound is discarded.

Change

  • iron-remote-desktop-rdp: a new audioPlayback(callback) extension. The callback receives { type: 'wave', sampleRate, channels, data } (interleaved 16-bit little-endian PCM in a Uint8Array), { type: 'volume', left, right } (0 to 1) and { type: 'close' }. Playing it (for example, scheduling Web Audio buffers) is left to the embedding application, as with the clipboard.
  • ironrdp-web: a WasmAudioBackend (RdpsndClientHandler) advertising uncompressed 16-bit PCM (stereo, 48, 44.1 and 22.05 kHz). It forwards what the server sends to the session loop, which calls the JavaScript callback. With a callback, enable_audio_playback is set in the client info.
  • Windows servers only start playback once RDPDR is up as well (FreeRDP enables device redirection along with audio for the same reason). Without a printer, a device-less RDPDR (NoopRdpdrBackend) is attached; with one, the printer's RDPDR serves, and the real RDPSND replaces the no-op one.
  • Off by default: without the extension, nothing changes.

Testing

  • New unit tests in crates/ironrdp-web/src/audio.rs: only 16-bit PCM is advertised, PCM blocks are forwarded with their rate and channel count, other formats are dropped, and volume and close are forwarded.
  • cargo test -p ironrdp-web --lib: 33 passed. The 19 clipboard::tests failures are the same on master (they need a browser for JsValue).
  • cargo xtask check fmt, cargo clippy -p ironrdp-web --all-targets -- -D warnings (host and wasm32-unknown-unknown), cargo xtask check typos, and npm run check in iron-remote-desktop-rdp.
  • In use: built from master with this change, the web client plays audio from Windows 11. Our end-to-end test plays a system sound inside the session and checks that PCM with a non-zero peak arrives. GNOME Remote Desktop 46 also works, together with fix(rdpsnd): echo the Training PDU's wPackSize in the Training Confirm #2019 (its Training Confirm check) and the graphics pipeline, which GNOME requires (fix(egfx): stop the desktop from tearing when the server resizes graphics output #1977).

Prepared with AI assistance; I reviewed the change and ran the tests above.

The web client had no audio output. An RDPSND client backend (16-bit PCM
at 48, 44.1 and 22.05 kHz) now forwards what the server sends to the
session loop, which hands it to the JavaScript callback given with the new
`audioPlayback(callback)` extension: `{ type: 'wave', sampleRate,
channels, data }`, `{ type: 'volume', left, right }` and
`{ type: 'close' }`. With a callback, audio playback is enabled in the
client info; without one, nothing changes.

Windows servers only start playback once RDPDR is up as well (FreeRDP
enables device redirection along with audio for the same reason), so a
device-less RDPDR is attached when no printer is.
meanaverage (meanaverage) added a commit to meanaverage/tabby-rdp that referenced this pull request Sep 27, 2026
… #1977

- Sound in the web client is now Devolutions/IronRDP#2020, rebased onto
  master on its own, with unit tests.
- Devolutions/IronRDP#1977 (another contributor's) turns the graphics
  pipeline on for every web connection and follows ResetGraphics: with
  it and our other pull requests, all GNOME and Windows suites pass
  without our patch 5, which goes when it lands.
- The plugin sets the graphicsPipeline extension only when the IronRDP
  build has it, so it keeps working once that patch is gone.
@github-actions github-actions Bot added kind/protocol Affects RDP or related protocol behavior risk/medium Behavioral change that does not substantially alter a core public API scope/web Affects the web/WASM ecosystem size/M Size: up to 449 counted lines and 10 files; exceeds S in either measure triage/overlap Possible overlap with another pull request; advisory only labels Sep 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request may overlap with #1764.

Both expose new RDP capabilities to the web client as WASM session-builder options: this PR adds an audio_playback extension plus RDPSND wiring, and #1764's title states it exposes additional WASM options. Evidence for #1764 is title-level only since its body is empty, so a human should compare the actual diffs.

This notice is advisory only. Automated review continues as usual, and how these pull requests relate is for maintainers and authors to decide.

Note

LLM-assisted content (no human feedback).

@github-actions github-actions Bot added the needs-review A human reviewer is the current next actor label Sep 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated review will not run because this contributor is not yet eligible under the automation policy.

Contributors become eligible after one qualifying IronRDP pull request is merged into master. Maintainer review is required.

@meanaverage

Copy link
Copy Markdown
Contributor Author

On the overlap note: I compared the diffs. #1764 adds pointer rendering, desktop scale, performance flags and time zone options, and no audio. The only contact point is its comment above the enable_audio_playback: false default in build_config, which says the web client doesn't play audio; with this PR, it does when audioPlayback is set (the default stays false). Both also add arms next to each other in the extension match, which merges by keeping both. Happy to adjust whichever lands second.

This branch was successfully deployed

1 active deployment
llm-providers — d51dbf4e Deployed Sep 27, 2026 by meanaverage via Classify pull request #734
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/protocol Affects RDP or related protocol behavior needs-review A human reviewer is the current next actor risk/medium Behavioral change that does not substantially alter a core public API scope/web Affects the web/WASM ecosystem size/M Size: up to 449 counted lines and 10 files; exceeds S in either measure triage/overlap Possible overlap with another pull request; advisory only

Development

Successfully merging this pull request may close these issues.

1 participant